/*
@STI LICENSE
(C) 2006-2008 Universit�t Innsbruck.

This file is part of myOntology.

myOntologyis free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

myOntologyis distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with myOntology.  If not, see <http://www.gnu.org/licenses/>.

@STI LICENSE */
package org.myontology.specialpages;

import java.io.Serializable;
import java.util.List;

/**
 * @author <a href="michael.hackl@sti2.at">Michael Hackl</a>
 * Project: Myontology - www.myontology.org
 * STI
 * This interface is used to define special pages, if you are not
 * entirely sure what to do, extend AbstractSpecialPageConfig
 * Many instances of the same special page share this config,
 * if implementing the functions, watch out to be free of side-effects
 * no storing data in instance variables, or unpredictable results can emerge
 */

public interface SpecialPageConfig extends Serializable{


	
	/**
	 * <code>execute</code> the default implementation combines 
	 * all steps needed to retrieve a prepared list for display
	 * so if you want to change that behaviour, override this method
	 * - select
	 * - sort
	 * - truncate
	 * @return the list of elements ready for display
	 */
	public List<EntryRow> execute();
	
	/**
	 * <code>isPageable</code> shows if paging is possible
	 * (showing the results on several pages)
	 * it is set via pageSize, if pageSize=0, paging is disabled 
	 * otherwise, the pageSize defines the number of results shown on the page
	 * 
	 * @return boolean
	 */
	public abstract boolean isPageable();

	/**
	 * 
	 * @return number of entries shown on a page, if 0, no paging
	 */
	public abstract int getPageSize();

	/**
	 * the number of entries that are returned, if 0 is returned the resultset
	 * is not truncated
	 * 
	 * @return 
	 */
	public abstract int getSetSize();

	/**
	 * the key is used to address a Config in the ConfigRegistry, so it has to be 
	 * a unique String-Value. If only one instance of the  Config is used, the usage of the
	 * fully qualified classname is adviced.
	 * @return
	 */
	public abstract String getKey();

	/**
	 * the label is used to display this config in a list for selection
	 * @return
	 */
	public abstract String getLabel();
	
	public abstract SpecialPageConfig cloneMe();

	/**
	 * sets the number of entries shown on one page, if 0 is set here, paging is disabled
	 * @param pageSize
	 */
	public void setPageSize(int pageSize);

	/**
	 * sets the number of entries that are returned, if 0 is returned the resultset
	 * is not truncated
	 * @param setSize
	 */
	public void setSetSize(int setSize);

	/**
	 * the key is used to address a Config in the ConfigRegistry, so it has to be 
	 * a unique String-Value. If only one instance of the  Config is used, the usage of the
	 * fully qualified classname is adviced.
	 * @param key
	 */
	public void setKey(String key);

	/**
	 * the label is used to display this config in a list for selection
	 * @param label
	 */
	public void setLabel(String label);

}
